<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>任务详情 - 威客平台</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    :root {
      --primary: #3B82F6;
      --primary-light: #EFF6FF;
      --secondary: #10B981;
      --warning: #F59E0B;
      --danger: #EF4444;
      --text-primary: #1F2937;
      --text-secondary: #6B7280;
      --bg-light: #F9FAFB;
      --bg-white: #FFFFFF;
      --border-light: #E5E7EB;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: var(--bg-light);
      color: var(--text-primary);
      line-height: 1.6;
      font-size: 15px;
      padding-bottom: 80px;
    }
    
    /* 顶部导航 */
    .navbar {
      background-color: var(--primary);
      color: white;
      padding: 0.75rem 1rem;
    }
    
    .navbar-nav .nav-link {
      color: rgba(255, 255, 255, 0.9);
      padding: 0.5rem 0.75rem;
    }
    
    .navbar-nav .nav-link.active {
      color: white;
      font-weight: 500;
    }
    
    /* 任务容器 */
    .task-container {
      background-color: var(--bg-white);
      margin-bottom: 10px;
      border-radius: 8px;
      overflow: hidden;
      border: 1px solid var(--border-light);
    }
    
    /* 任务头部 */
    .task-header {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .task-title {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 10px;
      color: var(--text-primary);
    }
    
    .task-meta {
      display: flex;
      justify-content: space-between;
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 10px;
    }
    
    .task-status {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 12px;
      font-size: 12px;
      font-weight: 500;
      background-color: var(--warning);
      color: white;
    }
    
    .status-open {
      background-color: var(--secondary);
    }
    
    .status-pending {
      background-color: var(--warning);
    }
    
    .status-closed {
      background-color: var(--text-secondary);
    }
    
    /* 任务信息 */
    .task-info {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .info-row {
      display: flex;
      margin-bottom: 12px;
    }
    
    .info-label {
      width: 80px;
      color: var(--text-secondary);
      flex-shrink: 0;
    }
    
    .info-value {
      flex: 1;
    }
    
    .task-price {
      font-size: 22px;
      font-weight: 700;
      color: var(--danger);
    }
    
    .task-category {
      display: inline-block;
      padding: 3px 10px;
      background-color: var(--primary-light);
      color: var(--primary);
      border-radius: 4px;
      font-size: 13px;
    }
    
    /* 任务图片 */
    .task-images {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .images-title {
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 10px;
    }
    
    .images-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }
    
    .task-image {
      width: 100%;
      aspect-ratio: 1;
      object-fit: cover;
      border-radius: 6px;
    }
    
    /* 任务描述 */
    .task-description {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
      line-height: 1.8;
    }
    
    .description-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 10px;
    }
    
    .description-content {
      color: var(--text-primary);
      white-space: pre-line;
    }
    
    /* 交付标准 */
    .delivery-requirements {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .requirements-list {
      padding-left: 20px;
      margin-bottom: 0;
    }
    
    .requirements-list li {
      margin-bottom: 8px;
    }
    
    /* 雇主信息 */
    .employer-info {
      padding: 15px;
      display: flex;
      align-items: center;
      gap: 12px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .employer-avatar {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .employer-details {
      flex: 1;
    }
    
    .employer-name {
      font-weight: 600;
      margin-bottom: 3px;
    }
    
    .employer-rating {
      color: var(--warning);
      font-size: 13px;
      margin-bottom: 3px;
    }
    
    .employer-meta {
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .contact-btn {
      padding: 6px 15px;
      background-color: var(--primary);
      color: white;
      border: none;
      border-radius: 4px;
      font-size: 14px;
      font-weight: 500;
    }
    
    /* 操作按钮区 */
    .action-buttons {
      display: flex;
      padding: 12px 15px;
      gap: 10px;
    }
    
    .action-btn {
      flex: 1;
      padding: 10px 0;
      border-radius: 6px;
      font-size: 15px;
      font-weight: 500;
      text-align: center;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    
    .primary-btn {
      background-color: var(--primary);
      color: white;
    }
    
    .secondary-btn {
      background-color: var(--bg-light);
      color: var(--text-primary);
      border: 1px solid var(--border-light);
    }
    
    /* 留言区 */
    .messages-section {
      background-color: var(--bg-white);
      border-radius: 8px;
      overflow: hidden;
      border: 1px solid var(--border-light);
      margin-bottom: 10px;
    }
    
    .messages-header {
      padding: 15px;
      font-weight: 600;
      border-bottom: 1px solid var(--border-light);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .messages-count {
      color: var(--text-secondary);
      font-weight: normal;
      font-size: 14px;
    }
    
    .message-sort {
      color: var(--primary);
      font-size: 14px;
      font-weight: normal;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    
    /* 留言输入框 */
    .message-input-container {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .message-input-wrapper {
      display: flex;
      gap: 10px;
    }
    
    .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .message-input-box {
      flex: 1;
      position: relative;
    }
    
    .message-input {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border-light);
      border-radius: 20px;
      font-size: 14px;
      resize: none;
      height: 40px;
      overflow: hidden;
    }
    
    .message-input:focus {
      outline: none;
      border-color: var(--primary);
    }
    
    .message-actions {
      display: none;
      position: absolute;
      right: 10px;
      bottom: -35px;
      gap: 10px;
    }
    
    .message-input:focus ~ .message-actions {
      display: flex;
    }
    
    .message-action-btn {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: none;
      background-color: var(--bg-light);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .send-message {
      background-color: var(--primary);
      color: white;
    }
    
    /* 留言列表 */
    .messages-list {
      margin: 0;
      padding: 0;
      list-style: none;
    }
    
    .message-item {
      padding: 15px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .message-header {
      display: flex;
      gap: 10px;
      margin-bottom: 8px;
    }
    
    .message-author-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .message-author-info {
      flex: 1;
    }
    
    .message-author-name {
      font-weight: 500;
      font-size: 14px;
    }
    
    .message-time {
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .message-content {
      font-size: 15px;
      margin-bottom: 8px;
      padding-left: 46px; /* 头像宽度 + 间距 */
    }
    
    .message-actions {
      display: flex;
      gap: 15px;
      padding-left: 46px;
      font-size: 13px;
    }
    
    .message-action {
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 4px;
    }
    
    .message-action.active {
      color: var(--primary);
    }
    
    /* 回复列表 */
    .replies-list {
      margin: 0;
      padding: 0 0 0 46px;
      list-style: none;
    }
    
    .reply-item {
      padding: 10px 0;
      border-top: 1px dashed var(--border-light);
      margin-top: 10px;
    }
    
    .reply-content {
      font-size: 14px;
      background-color: var(--bg-light);
      padding: 8px 12px;
      border-radius: 12px;
      margin-bottom: 5px;
    }
    
    .reply-author {
      font-weight: 500;
      color: var(--primary);
    }
    
    .reply-actions {
      display: flex;
      gap: 15px;
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    /* 底部操作栏 */
    .bottom-action-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: var(--bg-white);
      border-top: 1px solid var(--border-light);
      display: flex;
      padding: 10px 15px;
      gap: 10px;
    }
    
    .bottom-action {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px 0;
      border-radius: 8px;
      font-size: 15px;
      font-weight: 500;
      gap: 6px;
      text-decoration: none;
    }
    
    .bottom-action.primary {
      background-color: var(--primary);
      color: white;
    }
    
    .bottom-action.secondary {
      background-color: var(--bg-light);
      color: var(--text-primary);
      border: 1px solid var(--border-light);
    }
    
    /* 提示消息 */
    .toast {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      background-color: rgba(0, 0, 0, 0.7);
      color: white;
      padding: 6px 12px;
      border-radius: 4px;
      font-size: 14px;
      z-index: 1000;
      display: none;
    }
    
    /* 点赞动画 */
    @keyframes likePulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.3); }
      100% { transform: scale(1); }
    }
    
    .like-animation {
      animation: likePulse 0.3s ease;
    }
  </style>
</head>
<body>
  <!-- 顶部导航 -->
  <nav class="navbar navbar-expand">
    <div class="container-fluid">
      <ul class="navbar-nav w-100 justify-content-between">
        <li class="nav-item">
          <a class="nav-link" href="#" aria-label="返回">
            <i class="fa fa-arrow-left"></i>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link active" href="#">任务详情</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#" aria-label="分享">
            <i class="fa fa-share-alt"></i>
          </a>
        </li>
      </ul>
    </div>
  </nav>
  
  <!-- 任务容器 -->
  <div class="task-container">
    <!-- 任务头部 -->
    <div class="task-header">
      <div class="task-title">企业官网设计与前端开发，要求现代简约风格</div>
      <div class="task-meta">
        <span><i class="fa fa-clock-o"></i> 发布于 2小时前</span>
        <span class="task-status status-open">招标中</span>
      </div>
      <div class="task-meta">
        <span><i class="fa fa-map-marker"></i> 远程</span>
        <span><i class="fa fa-user-o"></i> 已有 12 人申请</span>
      </div>
    </div>
    
    <!-- 任务信息 -->
    <div class="task-info">
      <div class="info-row">
        <div class="info-label">任务价格</div>
        <div class="info-value task-price">¥5000</div>
      </div>
      <div class="info-row">
        <div class="info-label">任务分类</div>
        <div class="info-value">
          <span class="task-category">程序开发</span>
          <span class="task-category">网站设计</span>
        </div>
      </div>
      <div class="info-row">
        <div class="info-label">交付时间</div>
        <div class="info-value">15天内</div>
      </div>
      <div class="info-row">
        <div class="info-label">任务类型</div>
        <div class="info-value">远程任务 · 线上交付</div>
      </div>
      <div class="info-row">
        <div class="info-label">技能要求</div>
        <div class="info-value">HTML, CSS, JavaScript, React, UI设计</div>
      </div>
    </div>
    
    <!-- 任务图片 -->
    <div class="task-images">
      <div class="images-title">参考图片 (3)</div>
      <div class="images-grid">
        <img src="https://picsum.photos/400/400?random=1" alt="网站设计参考图1" class="task-image">
        <img src="https://picsum.photos/400/400?random=2" alt="网站设计参考图2" class="task-image">
        <img src="https://picsum.photos/400/400?random=3" alt="网站设计参考图3" class="task-image">
      </div>
    </div>
    
    <!-- 任务描述 -->
    <div class="task-description">
      <div class="description-title">任务详情</div>
      <div class="description-content">
        需要为科技公司设计并开发响应式官网，具体要求如下：

1. 风格：现代简约风格，符合科技企业形象
2. 页面包含：首页、产品展示、关于我们、联系我们
3. 技术栈：HTML5, CSS3, JavaScript, React
4. 响应式设计：适配PC、平板和手机端
5. 交互要求：包含适当的动画效果和过渡效果

我们会提供公司LOGO、产品资料和文字内容，希望开发者能提供完整的设计方案和开发代码，要求代码规范、可维护性强。

有意者请提供相关案例，我们会根据经验和报价选择合适的开发者。
      </div>
    </div>
    
    <!-- 交付标准 -->
    <div class="delivery-requirements">
      <div class="description-title">交付标准</div>
      <ul class="requirements-list">
        <li>完整的设计源文件（PSD或Figma）</li>
        <li>切图资源和图标库</li>
        <li>前端源代码（包含HTML、CSS、JS文件）</li>
        <li>响应式布局实现</li>
        <li>网站功能测试报告</li>
        <li>3个月的免费bug修复</li>
      </ul>
    </div>
    
    <!-- 雇主信息 -->
    <div class="employer-info">
      <img src="https://picsum.photos/200/200?random=10" alt="雇主头像" class="employer-avatar">
      <div class="employer-details">
        <div class="employer-name">科技创新有限公司</div>
        <div class="employer-rating">
          <i class="fa fa-star"></i>
          <i class="fa fa-star"></i>
          <i class="fa fa-star"></i>
          <i class="fa fa-star"></i>
          <i class="fa fa-star-half-o"></i>
          <span>4.8 (36条评价)</span>
        </div>
        <div class="employer-meta">
          <span>发布过 28 个任务</span> · 
          <span>注册时间 2020-05-12</span>
        </div>
      </div>
      <button class="contact-btn">联系雇主</button>
    </div>
    
    <!-- 操作按钮区 -->
    <div class="action-buttons">
      <button class="action-btn secondary-btn" id="favoriteBtn">
        <i class="fa fa-star-o"></i>
        <span>收藏</span>
      </button>
      <button class="action-btn secondary-btn" id="shareBtn">
        <i class="fa fa-share-alt"></i>
        <span>分享</span>
      </button>
      <button class="action-btn primary-btn" id="applyBtn">
        <i class="fa fa-hand-o-up"></i>
        <span>申请任务</span>
      </button>
    </div>
  </div>
  
  <!-- 留言区 -->
  <div class="messages-section">
    <div class="messages-header">
      留言讨论
      <div class="d-flex align-items-center gap-3">
        <span class="messages-count">18条留言</span>
        <div class="message-sort">
          <span>最新</span>
          <i class="fa fa-chevron-down"></i>
        </div>
      </div>
    </div>
    
    <!-- 留言输入框 -->
    <div class="message-input-container">
      <div class="message-input-wrapper">
        <img src="https://picsum.photos/200/200?random=99" alt="你的头像" class="user-avatar">
        <div class="message-input-box">
          <textarea class="message-input" placeholder="有疑问？请在此留言..."></textarea>
          <div class="message-actions">
            <button class="message-action-btn" title="添加图片">
              <i class="fa fa-image"></i>
            </button>
            <button class="message-action-btn" title="添加表情">
              <i class="fa fa-smile-o"></i>
            </button>
            <button class="message-action-btn send-message" title="发送">
              <i class="fa fa-paper-plane"></i>
            </button>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 留言列表 -->
    <ul class="messages-list">
      <!-- 留言1 -->
      <li class="message-item">
        <div class="message-header">
          <img src="https://picsum.photos/200/200?random=20" alt="留言者头像" class="message-author-avatar">
          <div class="message-author-info">
            <div class="message-author-name">王设计师</div>
            <div class="message-time">1小时前</div>
          </div>
        </div>
        <div class="message-content">
          您好，我有5年企业官网设计经验，能否提供更详细的品牌VI规范？另外，请问是否需要包含后端功能开发？
        </div>
        <div class="message-actions">
          <div class="message-action like-message">
            <i class="fa fa-thumbs-o-up"></i> 3
          </div>
          <div class="message-action reply-message">
            <i class="fa fa-reply"></i> 回复
          </div>
        </div>
        
        <!-- 回复列表 -->
        <ul class="replies-list">
          <li class="reply-item">
            <div class="reply-content">
              <span class="reply-author">科技创新有限公司</span>：
              我们会提供完整的VI规范，不需要后端开发，只需前端页面实现即可。
            </div>
            <div class="reply-actions">
              <div class="reply-action like-reply">
                <i class="fa fa-thumbs-o-up"></i> 1
              </div>
              <div class="reply-action reply-reply">
                <i class="fa fa-reply"></i> 回复
              </div>
            </div>
          </li>
        </ul>
      </li>
      
      <!-- 留言2 -->
      <li class="message-item">
        <div class="message-header">
          <img src="https://picsum.photos/200/200?random=21" alt="留言者头像" class="message-author-avatar">
          <div class="message-author-info">
            <div class="message-author-name">李前端</div>
            <div class="message-time">3小时前</div>
          </div>
        </div>
        <div class="message-content">
          请问网站预计有多少个页面？是否需要支持多语言切换？我可以提供类似案例参考。
        </div>
        <div class="message-actions">
          <div class="message-action like-message">
            <i class="fa fa-thumbs-o-up"></i> 2
          </div>
          <div class="message-action reply-message">
            <i class="fa fa-reply"></i> 回复
          </div>
        </div>
        
        <!-- 回复列表 -->
        <ul class="replies-list">
          <li class="reply-item">
            <div class="reply-content">
              <span class="reply-author">科技创新有限公司</span>：
              大约10个页面左右，暂时不需要多语言功能，后续可能会考虑增加。
            </div>
            <div class="reply-actions">
              <div class="reply-action like-reply">
                <i class="fa fa-thumbs-o-up"></i> 0
              </div>
              <div class="reply-action reply-reply">
                <i class="fa fa-reply"></i> 回复
              </div>
            </div>
          </li>
          <li class="reply-item">
            <div class="reply-content">
              <span class="reply-author">李前端</span> 回复 <span class="reply-author">科技创新有限公司</span>：
              好的，我明白了，我会准备一份详细的方案和报价。
            </div>
            <div class="reply-actions">
              <div class="reply-action like-reply">
                <i class="fa fa-thumbs-o-up"></i> 0
              </div>
              <div class="reply-action reply-reply">
                <i class="fa fa-reply"></i> 回复
              </div>
            </div>
          </li>
        </ul>
      </li>
      
      <!-- 留言3 -->
      <li class="message-item">
        <div class="message-header">
          <img src="https://picsum.photos/200/200?random=22" alt="留言者头像" class="message-author-avatar">
          <div class="message-author-info">
            <div class="message-author-name">张开发</div>
            <div class="message-time">昨天 18:35</div>
          </div>
        </div>
        <div class="message-content">
          我可以完成这个项目，包括设计和前端开发，使用React框架，15天内交付。请问什么时候可以开始？
        </div>
        <div class="message-actions">
          <div class="message-action like-message">
            <i class="fa fa-thumbs-o-up"></i> 5
          </div>
          <div class="message-action reply-message">
            <i class="fa fa-reply"></i> 回复
          </div>
        </div>
      </li>
    </ul>
    
    <!-- 加载更多 -->
    <div class="load-more" style="padding:15px; text-align:center; color:var(--primary); cursor:pointer;">
      加载更多留言
    </div>
  </div>
  
  <!-- 底部操作栏 -->
  <div class="bottom-action-bar">
    <a href="#" class="bottom-action secondary" id="reportBtn">
      <i class="fa fa-flag-o"></i>
      <span>举报</span>
    </a>
    <a href="#" class="bottom-action primary" id="applyBottomBtn">
      <i class="fa fa-hand-o-up"></i>
      <span>立即申请</span>
    </a>
  </div>
  
  <!-- 提示消息 -->
  <div class="toast" id="toast"></div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 获取DOM元素
    const applyBtn = document.getElementById('applyBtn');
    const applyBottomBtn = document.getElementById('applyBottomBtn');
    const favoriteBtn = document.getElementById('favoriteBtn');
    const shareBtn = document.getElementById('shareBtn');
    const reportBtn = document.getElementById('reportBtn');
    const toast = document.getElementById('toast');
    const messageInput = document.querySelector('.message-input');
    const sendMessageBtn = document.querySelector('.send-message');
    const contactBtn = document.querySelector('.contact-btn');
    
    // 显示提示消息
    function showToast(message) {
      toast.textContent = message;
      toast.style.display = 'block';
      
      setTimeout(() => {
        toast.style.display = 'none';
      }, 2000);
    }
    
    // 申请任务
    function handleApply() {
      showToast('申请已提交，请等待雇主回复');
    }
    
    applyBtn.addEventListener('click', handleApply);
    applyBottomBtn.addEventListener('click', handleApply);
    
    // 收藏功能
    favoriteBtn.addEventListener('click', function() {
      const icon = this.querySelector('i');
      const text = this.querySelector('span');
      
      if (icon.classList.contains('fa-star-o')) {
        icon.classList.replace('fa-star-o', 'fa-star');
        text.textContent = '已收藏';
        showToast('收藏成功');
      } else {
        icon.classList.replace('fa-star', 'fa-star-o');
        text.textContent = '收藏';
        showToast('取消收藏');
      }
    });
    
    // 分享功能
    shareBtn.addEventListener('click', function() {
      showToast('分享链接已复制到剪贴板');
    });
    
    // 举报功能
    reportBtn.addEventListener('click', function() {
      if (confirm('确定要举报此任务吗？')) {
        showToast('举报已提交，感谢你的反馈');
      }
    });
    
    // 联系雇主
    contactBtn.addEventListener('click', function() {
      showToast('只有已申请任务的用户才能联系雇主');
    });
    
    // 留言输入框自动调整高度
    messageInput.addEventListener('input', function() {
      this.style.height = 'auto';
      // 限制最大高度为120px
      this.style.height = Math.min(this.scrollHeight, 120) + 'px';
    });
    
    // 发送留言
    sendMessageBtn.addEventListener('click', function() {
      const messageText = messageInput.value.trim();
      if (messageText) {
        showToast('留言发表成功');
        messageInput.value = '';
        messageInput.style.height = '40px';
      } else {
        showToast('请输入留言内容');
      }
    });
    
    // 留言点赞功能
    document.querySelectorAll('.like-message').forEach(likeBtn => {
      likeBtn.addEventListener('click', function() {
        const icon = this.querySelector('i');
        let countText = this.textContent.trim().split(' ')[1];
        let count = parseInt(countText);
        
        if (icon.classList.contains('fa-thumbs-o-up')) {
          icon.classList.replace('fa-thumbs-o-up', 'fa-thumbs-up');
          this.classList.add('active');
          icon.classList.add('like-animation');
          this.innerHTML = `<i class="fa fa-thumbs-up"></i> ${count + 1}`;
          showToast('点赞成功');
        } else {
          icon.classList.replace('fa-thumbs-up', 'fa-thumbs-o-up');
          this.classList.remove('active');
          this.innerHTML = `<i class="fa fa-thumbs-o-up"></i> ${count - 1}`;
          showToast('取消点赞');
        }
        
        setTimeout(() => {
          icon.classList.remove('like-animation');
        }, 300);
      });
    });
    
    // 回复点赞功能
    document.querySelectorAll('.like-reply').forEach(likeBtn => {
      likeBtn.addEventListener('click', function() {
        const icon = this.querySelector('i');
        let countText = this.textContent.trim().split(' ')[1];
        let count = parseInt(countText || '0');
        
        if (icon.classList.contains('fa-thumbs-o-up')) {
          icon.classList.replace('fa-thumbs-o-up', 'fa-thumbs-up');
          this.classList.add('active');
          icon.classList.add('like-animation');
          this.innerHTML = `<i class="fa fa-thumbs-up"></i> ${count + 1}`;
          showToast('点赞成功');
        } else {
          icon.classList.replace('fa-thumbs-up', 'fa-thumbs-o-up');
          this.classList.remove('active');
          this.innerHTML = `<i class="fa fa-thumbs-o-up"></i> ${count - 1}`;
          showToast('取消点赞');
        }
        
        setTimeout(() => {
          icon.classList.remove('like-animation');
        }, 300);
      });
    });
    
    // 回复功能
    document.querySelectorAll('.reply-message, .reply-reply').forEach(replyBtn => {
      replyBtn.addEventListener('click', function() {
        let authorName;
        
        if (this.closest('.message-item')) {
          authorName = this.closest('.message-item').querySelector('.message-author-name').textContent;
        } else if (this.closest('.reply-item')) {
          authorName = this.closest('.reply-item').querySelector('.reply-author').textContent;
        }
        
        messageInput.value = `回复 @${authorName}：`;
        messageInput.style.height = 'auto';
        messageInput.style.height = Math.min(messageInput.scrollHeight, 120) + 'px';
        
        document.querySelector('.message-input-container').scrollIntoView({
          behavior: 'smooth'
        });
        messageInput.focus();
      });
    });
    
    // 加载更多留言
    document.querySelector('.load-more').addEventListener('click', function() {
      this.textContent = '加载中...';
      
      // 模拟加载延迟
      setTimeout(() => {
        this.textContent = '没有更多留言了';
        this.style.color = 'var(--text-secondary)';
        this.style.cursor = 'default';
      }, 1500);
    });
  </script>
</body>
</html>
